Skip to content

fix(workspace): harden Vela billing proxy boundaries - #6348

Merged
lefarcen merged 2 commits into
feat/workspace-teamfrom
fix/vela-proxy-wallet-hardening
Aug 3, 2026
Merged

fix(workspace): harden Vela billing proxy boundaries#6348
lefarcen merged 2 commits into
feat/workspace-teamfrom
fix/vela-proxy-wallet-hardening

Conversation

@lefarcen

@lefarcen lefarcen commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Why

Workspace delivery uncovered real hardening gaps in the daemon boundary that proxies Vela billing traffic. A malformed upstream wallet response could replace a valid cached balance, while normalized paths, malformed Workspace scopes, hop-by-hop headers, and disconnected clients were not rejected or cleaned up consistently.

This is a focused replacement for #6304. It keeps the production fixes and deterministic red specs, while deliberately excluding that draft's unrelated timeout increases and broad real-time test coverage.

What users will see

  • Valid Workspace-scoped Vela billing requests continue to use the exact caller-provided Workspace ID.
  • Malformed Workspace IDs and normalized paths outside /api/v1/ fail closed instead of being proxied or falling back to Personal scope.
  • Invalid wallet balances no longer replace a previously valid balance; the daemon returns the last valid snapshot as stale when one exists.
  • Disconnecting an upload or response tears down its upstream request instead of leaving work running.

Surface area

  • UI — new page / dialog / panel / menu item / setting / empty state in apps/web or apps/desktop (including Electron menu bar)
  • Keyboard shortcut — new or changed
  • CLI / env var — new od subcommand or flag, new tools-dev / tools-pack flag, or new OD_* env var
  • API / contract — new /api/* endpoint, new SSE event, or changed shape in packages/contracts
  • Extension point — new entry under skills/, design-systems/, design-templates/, or craft/, or change to the skills protocol
  • i18n keys — added new translation keys (see TRANSLATIONS.md for the locale workflow)
  • New top-level dependency — adding any new entry to the root package.json (dependencies or devDependencies); workspace-package package.json files are out of scope. Include a paragraph on what we get vs. what bytes we ship (see CONTRIBUTING.md → Code style)
  • Default behavior change — invalid wallet and proxy inputs now fail closed, and disconnected proxy requests are cleaned up
  • None — internal refactor, docs, tests, or translation update only

Screenshots

N/A — this is daemon-only billing and proxy hardening with no UI change.

Bug fix verification

  • Red specs: apps/daemon/tests/integrations/vela-wallet.test.ts and the Vela API proxy cases in apps/daemon/tests/integrations/vela.routes.test.ts.
  • The focused specs failed on the target base origin/feat/workspace-team@4a4dfadd (10 failures) and pass on this branch (12/12).
  • The complete affected files pass together (87/87).

Validation

  • pnpm exec vitest run -c vitest.config.ts tests/integrations/vela-wallet.test.ts tests/integrations/vela.routes.test.ts (87 passed)
  • pnpm --filter @open-design/daemon typecheck
  • pnpm --filter @open-design/daemon build
  • pnpm guard
  • pnpm typecheck
  • git diff --check origin/feat/workspace-team...HEAD

@lefarcen
lefarcen requested a review from mrcfps August 2, 2026 20:58
@lefarcen lefarcen added size/L PR changes 300-700 lines risk/high High risk: apps/desktop, daemon, auth, migration, workflows, package deps type/bugfix Bug fix labels Aug 2, 2026

@mrcfps mrcfps left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lefarcen Thanks for the focused hardening work here—the invalid-balance cache fallback, normalized-path validation, response/request header filtering, and disconnect cleanup are all covered at the right daemon boundary. I found one merge-safe scope-preservation edge in the new dynamic hop-by-hop filtering; details are inline.

🔁 Powered by Looper · runner=reviewer · agent=codex · An autonomous AI dev team for your GitHub repos.

Comment thread apps/daemon/src/routes/vela.ts
@lefarcen
lefarcen requested a review from mrcfps August 3, 2026 01:04

@mrcfps mrcfps left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lefarcen I reviewed all changed ranges on the current head and verified the wallet cache now rejects invalid decimal balances without replacing the last valid snapshot, the proxy validates normalized paths and Workspace scope before forwarding, hop-by-hop headers are removed in both directions, and aborted clients tear down upstream work. The follow-up commit also closes the earlier Connection-nominated Workspace header gap. The focused daemon suite passes 87/87 locally, with daemon typecheck, guard, and diff checks also clean. Thanks for the careful hardening and especially the deterministic regression coverage—this is a strong, focused fix. 🙌

🔁 Powered by Looper · runner=reviewer · agent=codex · An autonomous AI dev team for your GitHub repos.

@lefarcen
lefarcen merged commit 722a1c8 into feat/workspace-team Aug 3, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk/high High risk: apps/desktop, daemon, auth, migration, workflows, package deps size/L PR changes 300-700 lines type/bugfix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants